<template>
  <view class="noticeDetail">
    <view class="line">
      <view class="title">{{ detail.subject }}</view>
      <view class="time">{{
        $u.timeFormat(detail.updateDate, "yyyy-mm-dd hh:MM")
      }}</view>
    </view>
    <view class="content">{{ detail.content }}</view>
  </view>
</template>
<script setup>
import { onLoad } from "@dcloudio/uni-app";
import { ref } from "vue";
import { getShopNoticeDetail } from "@/api/home";
const detail = ref({});
const id = ref();
onLoad((params) => {
  if (params.id) {
    id.value = params.id;
    getDetail();
  }
});

const getDetail = async () => {
  const res = await getShopNoticeDetail({
    id: id.value,
  });
  detail.value = res;
};
</script>

<style lang="scss">
page {
  background-color: #fff;
}
.noticeDetail {
  padding: 20px 26px;
  .line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    .title {
      font-size: 13px;
      font-family: PingFangSC-Medium, PingFang SC;
      font-weight: 500;
      color: #4b4e50;
      line-height: 19px;
      max-height: 230px;
    }
    .time {
      font-size: 10px;
      font-family: PingFangSC-Regular, PingFang SC;
      font-weight: 400;
      color: #a0a0a0;
      line-height: 14px;
    }
  }
  .content {
    font-size: 12px;
    font-family: PingFangSC-Regular, PingFang SC;
    font-weight: 400;
    color: #4b4e50;
    line-height: 17px;
    margin-bottom: 12px;
  }
}
</style>
